﻿using System;
using System.Collections;
using System.Collections.Generic;
using Server.Misc;
using Server.Mobiles;
using Server.Commands;

namespace Server.Dna.Comandi
{
    class Invisibilita
    {
        public static void Initialize()
        {
            CommandSystem.Register("invis", AccessLevel.Counselor, new CommandEventHandler(Invis_OnCommand));
        }

        private static void Invis_OnCommand(CommandEventArgs e)
        {
            if (e.Mobile is PlayerMobile)
            {
                PlayerMobile m = (PlayerMobile)e.Mobile;
                if (m.Hidden)
                {
                    EffettoNasconditi(m);
                    m.Hidden = false;
                }
                else
                {
                    EffettoNasconditi(m);
                    m.Hidden = true;
                }
            }
        }

        private static void EffettoNasconditi(PlayerMobile m)
        {
            Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z + 4), m.Map, 0x3728, 13);
            Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z), m.Map, 0x3728, 13);
            Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z - 4), m.Map, 0x3728, 13);
            Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z + 4), m.Map, 0x3728, 13);
            Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z), m.Map, 0x3728, 13);
            Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z - 4), m.Map, 0x3728, 13);

            Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 11), m.Map, 0x3728, 13);
            Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 7), m.Map, 0x3728, 13);
            Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 3), m.Map, 0x3728, 13);
            Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z - 1), m.Map, 0x3728, 13);
            m.PlaySound(0x228);
        }
    }

    class MostraPrivilegi
    {
        public static void Initialize()
        {
            CommandSystem.Register("privshow", AccessLevel.Counselor, new CommandEventHandler(PrivShow_OnCommand));
        }

        private static void PrivShow_OnCommand(CommandEventArgs e)
        {
            PlayerMobile m = (PlayerMobile)e.Mobile;
            if (m.privshow)
            {
                m.privshow = false;
                m.SendMessage("Mostra privilegi OFF");
            }
            else
            {
                m.privshow = true;
                m.SendMessage("Mostra privilegi ON");
            }
        }
    }
}